package com.ethink.warehouse.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import com.ethink.framework.common.converter.Converter;
import com.ethink.warehouse.api.info.MateInventoryOtherOutLogDetailInfo;
import com.ethink.warehouse.common.entity.MateInventoryOtherOutLogDetail;

/**
 * 其他出库明细 Converter转换器
 *
 * @author default
 * @date 2023-02-08
 */
@Component
public class MateInventoryOtherOutLogDetailConverter implements Converter<MateInventoryOtherOutLogDetailInfo, MateInventoryOtherOutLogDetail> {

    @Override
    public MateInventoryOtherOutLogDetail convertTo(MateInventoryOtherOutLogDetailInfo info) {
        if(info == null) {
            return null;
        }
        MateInventoryOtherOutLogDetail entity = new MateInventoryOtherOutLogDetail ();
        BeanUtils.copyProperties(info, entity);
        return entity;
    }

    @Override
    public MateInventoryOtherOutLogDetailInfo convertFrom(MateInventoryOtherOutLogDetail entity) {
        if(entity == null) {
            return null;
        }
        MateInventoryOtherOutLogDetailInfo info = new MateInventoryOtherOutLogDetailInfo();
        BeanUtils.copyProperties(entity, info);
        return info;
    }
}
